package com.xiang.community.dao;

import com.xiang.community.dto.UserFocusDTO;
import com.xiang.community.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {

    User selectById(int id);

    User selectByName(String username);

    User selectByEmail(String email);

    int insertUser(User user);

    int updateStatus(int id, int status);

    int updateHeader(int id, String headerUrl);

    int updatePassword(int id, String password);

    int insertFocus(UserFocusDTO userFocusDTO);

    UserFocusDTO selectFocus(@Param("userOneId") Integer userOneId, @Param("userTwoId") Integer userTwoId);

    int updateFocus(Long id, int status);

    List<UserFocusDTO> selectFocusList(int userId);

    void deleteFocus(Long id);

    void updateField(String field, Object value, Integer userId);

    List<Integer> selectFolloweeList(int userId);

    List<Integer> selectFollowerList(int userId);
}
